import socket_practice

host = '127.0.0.1'
port = 1024

ss = socket_practice.socket(socket_practice.AF_INET, socket_practice.SOCK_DGRAM)

data = "你好!"

while data:
    ss.sendto(data.encode('utf-8'),(host,port))
    if data == 'bye':
        break
    data,addr = ss.recvfrom(1024)
    print("Reciver from Server:\n",data.decode('utf-8'))
    data = input("Please input info:\n")
ss.close()